package DAO;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import to.SolicitacaoDeAnalise;
import util.HibernateUtil;

public class GeraRelatorioDAO {
	
	public List<SolicitacaoDeAnalise> buscarTodas() throws Exception {

		List<SolicitacaoDeAnalise> listaRetorno = null;

		try {

			Session session = HibernateUtil.getSessionFactory().openSession();
			Criteria criteria = session
					.createCriteria(SolicitacaoDeAnalise.class);
			criteria.addOrder(Order.asc("dataEntrada"));
			listaRetorno = (List<SolicitacaoDeAnalise>) criteria.list();

		} catch (Exception e) {
			e.printStackTrace();
		}

		return listaRetorno;

	}

}
